﻿using System.Collections.Generic;

namespace PoliticalClassifier.Support
{
    /// <summary>
    /// Interface represents the primitive functionality offered by IDataSetSource
    /// responsible for Opening, reading and invalidating a given data.
    /// </summary>
    public interface IDataSetSource
    {
        /// <summary>
        /// Open, read and validate a given file.
        /// </summary>
        /// <param name="fileName"></param>
        /// <returns>Any validation errors.</returns>
        IDataSourceLoadResults Load(string fileName);

        /// <summary>
        /// Create an instance of data source load results pre-loaded with an 
        /// unknown error instance.
        /// </summary>
        /// <returns>Unknown load results.</returns>
        IDataSourceLoadResults CreateUnknownErrorLoadResults();

        /// <summary>
        /// Returns the collection of IVotersRecords on successful opening a given file.
        /// Otherwise returns null.
        /// </summary>
        ICollection<IVoterRecord> VotersRecord { get; }

        /// <summary>
        /// Return the status of the file if opened successfully.
        /// </summary>
        bool IsFileOpenedSuccessfully { get; }

        /// <summary>
        /// Return the count of ignored records.
        /// </summary>
        int IgnoredRowsCount { get; }

        /// <summary>
        /// Returns the names of the columns in the data source.
        /// </summary>
        string[] ColumnNames { get; }
    }
}
